/*
 * ErrorState.cpp
 *
 *  Created on: 11 dec. 2012
 *      Author: Admin
 */

#include "ErrorState.hpp"
#include "HardwareController.hpp"
#include "Robot.hpp"

void ErrorState::handleEvent(Event& event)
{
	//Ignore everything
}

void ErrorState::initState()
{
	//Stop actuators
	Robot::getInstance().getEngine().stop();
	//Blink LED forever
	while (true)
	{
		HardwareController::getHardwareController().wait(50);
		HardwareController::getHardwareController().activateLED();
		HardwareController::getHardwareController().wait(50);
		HardwareController::getHardwareController().disableLED();
	}
}

State::StateType ErrorState::getStateType()
{
	return State::ERROR;
}
